﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CqusInfo.RAL.Infomation;

namespace CqusInfo.DAL.Infomation.Inteface
{
    public interface IInfomationDAL
    {
        /// <summary>
        /// 得到表的总条数
        /// </summary>
        /// <param name="isDel">true：已删除 false：未删除</param>
        /// <returns></returns>
        Int32 GetCounts(bool isDel);

        /// <summary>
        /// 新增数据
        /// </summary>
        /// <param name="model">数据集</param>
        /// <returns>1：成功 0：失败</returns>
        Int32 Add(InfomationModel model);

        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="iId">功能ID</param>
        /// <param name="model">数据集</param>
        /// <returns>1：成功 0：失败</returns>
        Int32 Update(string iId, InfomationModel model);

        /// <summary>
        /// 删除数据，包括彻底删除和伪删除
        /// </summary>
        /// <param name="iId">信息ID</param>
        /// <param name="isDel">true：已删除 false：未删除</param>
        /// <param name="trueDel">true：彻底删除 false：执行伪删除</param>
        /// <returns>1：成功 0：失败</returns>
        Int32 Delete(string iId, bool isDel, bool trueDel);

        /// <summary>
        /// 查询具体信息
        /// </summary>
        /// <param name="iId">查询ID</param>
        /// <returns>List<InfomationModel></returns>
        List<InfomationModel> Query(string iId);

        /// <summary>
        /// 按权重查询
        /// 0：普通资讯，1：热点资讯2：头条资讯
        /// </summary>
        /// <param name="status">0：普通资讯，1：热点资讯2：头条资讯</param>
        /// <param name="page">页数，第几页 需减一</param>
        /// <param name="takeItem">每页显示的数目</param>
        /// <returns> List<InfomationModel></returns>
        List<InfomationModel> Query(Int32 status, Int32 page, Int32 takeItem);

        /// <summary>
        /// 按作者查询
        /// </summary>
        /// <param name="userName">作者名</param>
        /// <param name="title">新闻标题</param>
        /// <param name="isDel">true：已删除 false：未删除</param>
        /// <param name="page">页数，第几页 需减一</param>
        /// <param name="takeItem">每页显示的数目</param>
        /// <returns>List<InfomationModel></returns>
        List<InfomationModel> Query(string userName, string title, bool isDel, Int32 page, Int32 takeItem);

        /// <summary>
        /// 按时间查询
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="isDel">true：已删除 false：未删除</param>
        /// <returns>List<InfomationModel></returns>
        List<InfomationModel> Query(DateTime startTime, DateTime endTime, bool isDel, Int32 page, Int32 takeItem);

        /// <summary>
        /// 查询所有包括已删除或者未删除的信息
        /// </summary>
        /// <param name="page">页数，第几页 需减一</param>
        /// <param name="takeItem">每页显示的数目</param>
        /// <param name="isDel">true:已删除 false：未删除</param>
        /// <returns>List<InfomationModel></returns>
        List<InfomationModel> Query(Int32 page, Int32 takeItem, bool isDel);
    }
}
